<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>风味-登录</title>
		<link rel="stylesheet" type="text/css" href="css/loginPublicStyle.css"/>
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
		<script src="js/jquery-2.1.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/overAll.js"></script>
		<script>
			$(function(){
				var loginBtn = $("#denglu");
				loginBtn.click(function(){
					var userPhone = $("input[name = 'usernum']").val();
					var password = $("input[name = 'userpwd']").val();
					$.ajax("/user/loginUser",{
						type:"post",
						data:{
							'userPhone':userPhone,
							'password':password
						},

						success:function(data){
						
							if(data=="false"||data=="none"){
								alert("密码不正确或没有该用户！")
							}else{
								var dataObj = eval('('+data+')')
								show(dataObj)
							}
						},
						error:function(data){
							console.log(data);
						}

					})
					function show(dataObj){
						var a = dataObj.userId;
						window.location.href = "Home.html";
					}

				})

				function forgetpwd(dataObj){
					var a = dataObj.userId;
					var forgetpwd = $("#forgetpwd");
					forgetpwd.click(function(){
						window.location.href = "foundPwd.html?userId="+a+"";
					})
				}


				

			})

		</script>
	</head>
	<body>
		<a id="back">
			<a href="#" id="back_a"><</a>
		</a>
		<div id="blackmask"><!--背景图上的黑色遮罩-->
		</div>
		<div id="login_bg"><!--login的背景-->
			<img src="img/login_bg.jpg"/>
			</div>
		<div id="logo"><!--头部logo部分-->
			<img class="logo_img" src="img/logo.png">
		</div>
		
		<div id="login_con"><!--登录表单部分-->
			<div id="useraccount">
				<i class="user-ico"></i>
				<input type="text" name="usernum" id="usernum" placeholder="您的账户" />
			</div>
			<div id="userpwd">
				<i class="pwd-ico"></i>
				<input type="password" name="userpwd" id="user_pwd" placeholder="您的密码" />
			</div>
			<input type="button" name="denglu" id="denglu" value="登录" />
		</div>
	
		<a href="forgetpwd.html" id="forgetpwd">忘记密码？</a>
		<a href="regest.html" id="join">没有账号？立即加入我们>></a>
	
	</body>
</html>
